package com.huike.web.controller.report;


import com.huike.report.domain.vo.DragonVo;
import com.huike.report.domain.vo.IndexTodayInfoVO;
import com.huike.report.domain.vo.IndexTodoInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.huike.common.core.domain.AjaxResult;
import com.huike.report.service.IReportService;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IReportService reportService;


    /**
     * 首页--基础数据统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    @GetMapping("/getBaseInfo")
    public AjaxResult getBaseInfo(@RequestParam("beginCreateTime") @DateTimeFormat String beginCreateTime,
                                  @RequestParam("endCreateTime") String endCreateTime){
        return AjaxResult.success(reportService.getBaseInfo(beginCreateTime,endCreateTime));
    }

/*需求：
当前用户**在**当天的线索数量**，**商机数量**，**合同数量**，**成交的金额**
当前用户的线索 商机 合同 成交金额都**不需要考虑状态**只要是今日做的**哪怕是回收了删除了都要考虑**
以便当前销售人员进行复盘分析工作，用来分析今天操作了多少线索，商机，合同等
线索数量、商机数量、合同数量、最终成交的合同金额*/

    @GetMapping("/getTodayInfo")
    public AjaxResult getTodayInfo(){
        return AjaxResult.success(reportService.getTodayInfo());
    }

    @GetMapping("/getTodoInfo")
    public AjaxResult getTodoInfo(String beginCreateTime,String endCreateTime){

        return AjaxResult.success(reportService.getTodoInfo(beginCreateTime,endCreateTime));
    }
    /**商机转化龙虎榜接口*/
    @GetMapping("/businessChangeStatistics")
    public AjaxResult businessChangeStatistics(String beginCreateTime,String endCreateTime){
        return AjaxResult.success(reportService.getbusinessChangeStatistics(beginCreateTime,endCreateTime));
    }
    @GetMapping("/salesStatistic")
    public AjaxResult salesStatistic(String beginCreateTime,String endCreateTime){

        return AjaxResult.success(reportService.getsalesStatistic(beginCreateTime,endCreateTime));
    }
}